//
//  UserTableHeaderView.m
//  Water
//
//  Created by yh on 2017/11/27.
//  Copyright © 2017年 chenguibang. All rights reserved.
//

#import "UserTableHeaderView.h"
#import <GPUImage.h>
@implementation UserTableHeaderView


- (void)awakeFromNib{
    [super awakeFromNib];
    
    self.headerImageView.layer.cornerRadius = self.headerImageView.frame.size.width/2;
    self.headerImageView.layer.masksToBounds = YES;
    
    UIImage *image = [UIImage imageNamed:@"waterbg"];
    
    GPUImageGaussianBlurFilter *filter = [[GPUImageGaussianBlurFilter alloc] init];
    filter.texelSpacingMultiplier = 2.0;
    filter.blurRadiusInPixels = 1.0;
    [filter forceProcessingAtSize:image.size];
    GPUImagePicture *pic = [[GPUImagePicture alloc] initWithImage:image];
    [pic addTarget:filter];
    [pic processImage];
    [filter useNextFrameForImageCapture];
    self.bgImageView.image = [filter imageFromCurrentFramebuffer];
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
